<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>员工管理</title>
    <%@include file="/WEB-INF/views/commons/commons.jsp" %>
    <script type="text/javascript" src="/static/js/system/employee.js"></script>
</head>
<body>
<table id="emp_datagrid"></table>

<!-- 表格顶部工具栏 -->
<div id="tb">
    <a href="#" class="easyui-linkbutton"
       data-options="iconCls:'icon-add',plain:true" data-cmd="add">新增</a> <a
        href="#" class="easyui-linkbutton"
        data-options="iconCls:'icon-edit',plain:true" data-cmd="edit">编辑</a>
    <a href="#" class="easyui-linkbutton"
       data-options="iconCls:'icon-remove',plain:true" data-cmd="changeState" id="change_btn">离职</a>
    <a href="#" class="easyui-linkbutton"
       data-options="iconCls:'icon-reload',plain:true" data-cmd="reload">刷新</a>

    <input class="easyui-textbox" name="keyword" id="keyword" style="width: 200px" prompt="按照名字或电话查询">
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true"
       data-cmd="query">查询</a>

</div>

<!-- 员工新增或编辑 -->
<div id="emp_dialog">
    <center>
        <form id="emp_form" method="post">
            <input type="hidden" id="empId" name="id">
            <table align="center" style="margin-top: 15px">
                <tr>
                    <td>账号</td>
                    <td>
                        <input name="username" class="easyui-textbox" type="text" prompt="请输入用户名"
                               invalidMessage="用户名已存在"
                               validType="remote['/employee/validateUsername?id='+empId.value,'username']"
                        >
                    </td>
                </tr>

                <tr>
                    <td>真名</td>
                    <td><input class="easyui-textbox" name="realname" data-options="required:true">
                    </td>
                </tr>

                <tr>
                    <td>电话</td>
                    <td><input class="easyui-textbox" name="tel">
                    </td>
                </tr>

                <tr>
                    <td>邮箱</td>
                    <td><input class="easyui-textbox" name="email" data-options="validType:'email'">
                    </td>
                </tr>

                <tr>
                    <td>部门</td>
                    <td><input class="easyui-combobox" name="dept.id" data-options="
                    valueField: 'id',textField: 'name', panelHeight:'auto',
                    url:'/department/queryDepts'
                    ">
                    </td>
                </tr>

                <tr>
                    <td>入职时间</td>
                    <td><input class="easyui-datebox" name="hiredate" data-options="required:true">
                    </td>
                </tr>

                <tr>
                    <td>管理员</td>
                    <td><input class="easyui-combobox" name="admin" data-options="
                valueField: 'value',textField: 'label', panelHeight:'auto',
                    data: [{
                            label: '是',
                            value: '1'
                        },{
                            label: '否',
                            value: '0'
                        }]
                    ">
                    </td>
                </tr>
                <tr>
                    <td>角色</td>
                    <td><input class="easyui-combobox" id="emp_roles" data-options="
                    valueField: 'id',textField: 'name', panelHeight:'auto',
                    url:'/role/queryData',multiple:true
                    ">
                    </td>
                </tr>
            </table>
        </form>
    </center>
</div>

<!-- 新增编辑底部按钮 -->
<div id="bb">
    <a href="#" class="easyui-linkbutton"
       data-options="iconCls:'icon-save',plain:true"
       data-cmd="save">保存</a> <a
        href="#" class="easyui-linkbutton"
        data-options="iconCls:'icon-cancel',plain:true" data-cmd="cancel">取消</a>
</div>

</body>
</html>